import { AfterViewInit, Component, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';
import { ActivatedRoute } from '@angular/router';

@Component({
  selector: 'ne-dashboard',
  templateUrl: './dashboard.component.html',
  styleUrls: ['./dashboard.component.scss']
})
export class DashboardComponent implements OnInit, OnChanges, AfterViewInit, OnDestroy {

  public myVariable: number;
  constructor(private router: ActivatedRoute) {
    this.myVariable = 0;
    console.log("Dashboard Constructor",this.myVariable)
  }

  
  ngOnChanges(changes: SimpleChanges): void {
    if( typeof changes.myVariable.currentValue === "string" ) {
      this.myVariable = changes.myVariable.previousValue;
    }
  }
  
  ngOnInit(): void {
    this.myVariable = 2;
    console.log("NGONINIT", this.myVariable)
  }
  
  ngAfterViewInit(): void {
    
  }

  ngOnDestroy() {
    
  }
}
